package com.broada.apm.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Date;

/**
 * 服务资源实体类<br/>
 * 
 * @author louyi Create By 2014年12月22日 下午1:41:47
 */
public class Service extends BaseResource implements Serializable {
	public static final int TCP = 6, UDP = 17;
	public static final int NodeTypeNode = 1, NodeTypeCluster = 2,NodeTypeClusterNode = 3, NodeTypeLabel = 4;
	/**
	 * <code>serialVersionUID</code>
	 */
	private static final long serialVersionUID = 1L;
	private String ip;
	private long ipNum;
	private int port;
	private Date createdAt;
	private int x;
	private int y;
	private String size = "large";
	/**
	 * 手工指定的协议类型 前端未指定默认显示autoDiscoveryProtocol
	 */
	private int protocol;
	/**
	 * 自动发现的协议类型
	 */
	private int autoDiscoveryProtocol;
	/**
	 * 传输协议 tcp=6, udp=17
	 */
	private int l4protocol = 6;
	/**
	 * 自动发现或者手工建立 自动 system 手工 manual
	 */
	private String createBy = "system";

	/**
	 * 1为节点，2为集群，3为集群子节点
	 */
	private int nodeType = 1;
	private String[] nodeIds;
	/**
	 * 端口上行流量
	 */
	private long tx;
	/**
	 * 端口下行流量
	 */
	private long rx;
	private String lua;
	private int focus;
	private String picUrl;
	// 集群节点中发送数据到此节点的节点
	private String[] filterIps;
	
	public int getProtocol() {
		return protocol;
	}

	public void setProtocol(int protocol) {
		this.protocol = protocol;
	}

	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}

	public Date getCreatedAt() {
		return createdAt;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public long getIpNum() {
		return ipNum;
	}

	public void setIpNum(long ipNum) {
		this.ipNum = ipNum;
	}

	public int getPort() {
		return port;
	}

	public void setPort(int port) {
		this.port = port;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	public String getSize() {
		return size;
	}

	public void setSize(String size) {
		this.size = size;
	}

	public int getNodeType() {
		return nodeType;
	}

	public void setNodeType(int nodeType) {
		this.nodeType = nodeType;
	}

	public String[] getNodeIds() {
		return nodeIds;
	}

	public void setNodeIds(String[] nodeIds) {
		this.nodeIds = nodeIds;
	}

	public void setL4protocol(int l4protocol) {
		this.l4protocol = l4protocol;
	}

	public int getL4protocol() {
		return l4protocol;
	}

	public String getCreateBy() {
		return createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}

	public int getAutoDiscoveryProtocol() {
		return autoDiscoveryProtocol;
	}

	public void setAutoDiscoveryProtocol(int autoDiscoveryProtocol) {
		this.autoDiscoveryProtocol = autoDiscoveryProtocol;
	}

	public long getTx() {
		return tx;
	}

	public void setTx(long tx) {
		this.tx = tx;
	}

	public long getRx() {
		return rx;
	}

	public void setRx(long rx) {
		this.rx = rx;
	}

	public String getLua() {
		return lua;
	}

	public void setLua(String lua) {
		this.lua = lua;
	}

	public int getFocus() {
		return focus;
	}

	public void setFocus(int focus) {
		this.focus = focus;
	}

	public String getPicUrl() {
		return picUrl;
	}

	public void setPicUrl(String picUrl) {
		this.picUrl = picUrl;
	}

	public String[] getFilterIps() {
		return filterIps;
	}

	public void setFilterIps(String[] filterIps) {
		this.filterIps = filterIps;
	}

	@Override
	public String toString() {
		return "Service [ip=" + ip + ", ipNum=" + ipNum + ", port=" + port + ", createdAt=" + createdAt + ", x=" + x
				+ ", y=" + y + ", size=" + size + ", protocol=" + protocol + ", autoDiscoveryProtocol=" + autoDiscoveryProtocol
				+ ", l4protocol=" + l4protocol + ", createBy=" + createBy + ", nodeType=" + nodeType + ", nodeIds="
				+ Arrays.toString(nodeIds) + "]";
	}

}
